1. Technical Field
The present invention relates to a method and system for data processing in general, and in particular to a method and system for performing a numerical estimation within a data processing system. Still more particularly, the present invention relates to a method and system for performing a power of two estimation within a data processing system.
2. Description of the Prior Art
An exponential function, such as a power of two function, is commonly encountered in graphical applications. However, many processor cycles are typically required for the execution of an exponential function in a general purpose processor that does not have an exponential function in its instruction set. Even for processors having an exponential function in their instruction set, several processor cycles are required to execute an exponential function via microcode.
In view of the above, the present disclosure describes a fast implementation of a power of two function, i.e., y=2.sup.x, for a general purpose processor, where both the argument x and the result y are represented in a floating-point format. Without loss of generality, the floating-point format used for the purpose of illustration is the IEEE 754 format. Due to the nature of the power of two function, the practical range of values of argument x is typically restricted to a very small portion of the normal range, otherwise result y will fall outside the representable range of values.